namespace Example.Controllers
{
    using System.Globalization;
    using System.Threading;
    using System.Web.Mvc;
    using SimpleWebServices;
    using SimpleWebServices.Web.Mvc;
    using Xunit;

    public sealed class HomeControllerFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<HomeController>()
                .DerivesFrom<ResourceController>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .IsDecoratedWith<InternalServerErrorAttribute>()
                .Allow("GET, HEAD, OPTIONS")
                .IsDecoratedWith<CacheControlAttribute>()
                .IsDecoratedWith<ContentLanguageAttribute>()
                .IsDecoratedWith<ContentLocationAttribute>()
                .IsDecoratedWith<ContentMD5Attribute>()
                .Resource("home")
                .Result);
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new HomeController());
        }

        [Fact]
        public void op_HtmlRepresentation_CultureInfo()
        {
            CultureInfo culture = Thread.CurrentThread.CurrentUICulture;

            try
            {
                Assert.IsAssignableFrom<ViewResult>(new HomeController().HtmlRepresentation(new CultureInfo("en")));
            }
            finally
            {
                Thread.CurrentThread.CurrentUICulture = culture;
            }
        }

        [Fact]
        public void op_XhtmlRepresentation_CultureInfo()
        {
            CultureInfo culture = Thread.CurrentThread.CurrentUICulture;

            try
            {
                Assert.IsAssignableFrom<ViewResult>(new HomeController().XhtmlRepresentation(new CultureInfo("en")));
            }
            finally
            {
                Thread.CurrentThread.CurrentUICulture = culture;
            }
        }
    }
}